package com.example.w_library.log.base;


import com.example.w_library.log.priter.WLogPrinter;
import com.example.w_library.log.fromat.WStackTraceFormatter;
import com.example.w_library.log.fromat.WThreadFormatter;

/**
 * 日志配置相关
 */
public abstract class WLogConfig {

    //每行最大长度
    public static int MAX_LEN = 512;

    public static WThreadFormatter THREAD_FORMATTER = new WThreadFormatter();

    public static WStackTraceFormatter STACK_TRACE_FORMATTER = new WStackTraceFormatter();

    /**
     * 默认 Tag
     * @return
     */
    public String getGlobalTag(){
        return "WLog";
    }

    /**
     * 是否开启日志
     * @return
     */
    public boolean enable(){
        return true;
    }

    /**
     * 是否包含线程信息
     * @return
     */
    public boolean includeTread(){
        return false;
    }

    /**
     * 默认线程深度
     * @return
     */
    public int stackTraceDepth(){
        return 1;
    }

    /**
     * 注册打印器
     * @return
     */
    public WLogPrinter[] printers(){
        return null;
    }

    /**
     * 注入序列化器
     * @return
     */
    public JsonParser injectJsonParser(){
        return null;
    }


    /**
     * json 序列化接口进行解偶
     */
    public interface JsonParser{
        String toJson(Object src);
    }
}
